<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <meta name="Content-Type" content="text/html; charset=UTF-8" />
<title>Sass Documentation</title>
<link rel="stylesheet" href="style.css" tppabs="http://sass-lang.com/docs/yardoc/css/style.css" type="text/css" media="screen" charset="utf-8" />
<link rel="stylesheet" href="common.css" tppabs="http://sass-lang.com/docs/yardoc/css/common.css" type="text/css" media="screen" charset="utf-8" />

<script type="text/javascript" charset="utf-8">
  relpath = '';
  if (relpath != '') relpath += '/';
</script>
<script type="text/javascript" charset="utf-8" src="jquery.js" tppabs="http://sass-lang.com/docs/yardoc/js/jquery.js"></script>
<script type="text/javascript" charset="utf-8" src="app.js" tppabs="http://sass-lang.com/docs/yardoc/js/app.js"></script>

  </head>
  <body>
    <script type="text/javascript" charset="utf-8">
      if (window.top.frames.main) document.body.className = 'frames';
    </script>
    
    <div id="header">
      <div id="menu">
  
    <a href="_index.html" tppabs="http://sass-lang.com/docs/yardoc/_index.html" title="Index">Index</a> &raquo; 
    <span class="title">File: README</span>
  
  
  <div class="noframes"><span class="title">(</span><a href="..htm" tppabs="http://sass-lang.com/docs/yardoc/." target="_top">no frames</a><span class="title">)</span></div>
</div>

      <div id="search">
  <a id="class_list_link" href="#">Class List</a>
  <a id="method_list_link" href="#">Method List</a>
  <a id ="file_list_link" href="#">File List</a>
</div>

      <div class="clear"></div>
    </div>
    
    <iframe id="search_frame"></iframe>
    
    <div id="content"><div id='filecontents'><h1 id='sass'>Sass</h1>

<p><strong>Sass makes CSS fun again</strong>. Sass is an extension of CSS3, adding nested rules, variables, mixins, selector inheritance, and more. It&#8217;s translated to well-formatted, standard CSS using the command line tool or a web-framework plugin.</p>

<p>Sass has two syntaxes. The new main syntax (as of Sass 3) is known as &#8220;SCSS&#8221; (for &#8220;Sassy CSS&#8221;), and is a superset of CSS3&#8217;s syntax. This means that every valid CSS3 stylesheet is valid SCSS as well. SCSS files use the extension <code>.scss</code>.</p>

<p>The second, older syntax is known as the indented syntax (or just &#8220;Sass&#8221;). Inspired by Haml&#8217;s terseness, it&#8217;s intended for people who prefer conciseness over similarity to CSS. Instead of brackets and semicolons, it uses the indentation of lines to specify blocks. Although no longer the primary syntax, the indented syntax will continue to be supported. Files in the indented syntax use the extension <code>.sass</code>.</p>

<h2 id='using'>Using</h2>

<p>Sass can be used from the command line or as part of a web framework. The first step is to install the gem:</p>

<pre class="code">gem install sass</pre>

<p>After you convert some CSS to Sass, you can run</p>

<pre class="code">sass style.scss</pre>

<p>to compile it back to CSS. For more information on these commands, check out</p>

<pre class="code">sass --help</pre>

<p>To install Sass in Rails 2, just add <code>config.gem &quot;sass&quot;</code> to <code>config/environment.rb</code>. In Rails 3, add <code>gem &quot;sass&quot;</code> to your Gemfile instead. <code>.sass</code> or <code>.scss</code> files should be placed in <code>public/stylesheets/sass</code>, where they&#8217;ll be automatically compiled to corresponding CSS files in <code>public/stylesheets</code> when needed (the Sass template directory is customizable&#8230; see <a href="file.SASS_REFERENCE.html#template_location-option" tppabs="http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#template_location-option">the Sass reference</a> for details).</p>

<p>Sass can also be used with any Rack-enabled web framework. To do so, just add</p>

<pre class="code">require &#39;sass/plugin/rack&#39;
use Sass::Plugin::Rack</pre>

<p>to <code>config.ru</code>. Then any Sass files in <code>public/stylesheets/sass</code> will be compiled into CSS files in <code>public/stylesheets</code> on every request.</p>

<p>To use Sass programatically, check out the <a href="index.htm" tppabs="http://sass-lang.com/docs/yardoc/">YARD documentation</a>.</p>

<h2 id='formatting'>Formatting</h2>

<p>Sass is an extension of CSS that adds power and elegance to the basic language. It allows you to use <a href="javascript:if(confirm(%27http://beta.sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html  \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address.  \n\nDo you want to open it from the server?%27))window.location=%27http://beta.sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#variables_%27" tppabs="http://beta.sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#variables_">variables</a>, <a href="javascript:if(confirm(%27http://beta.sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html  \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address.  \n\nDo you want to open it from the server?%27))window.location=%27http://beta.sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#nested_rules_%27" tppabs="http://beta.sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#nested_rules_">nested rules</a>, <a href="javascript:if(confirm(%27http://beta.sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html  \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address.  \n\nDo you want to open it from the server?%27))window.location=%27http://beta.sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#mixins%27" tppabs="http://beta.sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#mixins">mixins</a>, <a href="javascript:if(confirm(%27http://beta.sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html  \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address.  \n\nDo you want to open it from the server?%27))window.location=%27http://beta.sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#import%27" tppabs="http://beta.sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#import">inline imports</a>, and more, all with a fully CSS-compatible syntax. Sass helps keep large stylesheets well-organized, and get small stylesheets up and running quickly, particularly with the help of <a href="javascript:if(confirm(%27http://compass-style.org/  \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address.  \n\nDo you want to open it from the server?%27))window.location=%27http://compass-style.org/%27" tppabs="http://compass-style.org/">the Compass style library</a>.</p>

<p>Sass has two syntaxes. The one presented here, known as &#8220;SCSS&#8221; (for &#8220;Sassy CSS&#8221;), is fully CSS-compatible. The other (older) syntax, known as the indented syntax or just &#8220;Sass&#8221;, is whitespace-sensitive and indentation-based. For more information, see the <a href="javascript:if(confirm(%27http://beta.sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html  \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address.  \n\nDo you want to open it from the server?%27))window.location=%27http://beta.sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#syntax%27" tppabs="http://beta.sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#syntax">reference documentation</a>.</p>

<p>To run the following examples and see the CSS they produce, put them in a file called <code>test.scss</code> and run <code>sass test.scss</code>.</p>

<h3 id='nesting'>Nesting</h3>

<p>Sass avoids repetition by nesting selectors within one another. The same thing works for properties.</p>

<pre class="code">table.hl {
  margin: 2em 0;
  td.ln { text-align: right; }
}

li {
  font: {
    family: serif;
    weight: bold;
    size: 1.2em;
  }
}</pre>

<h3 id='variables'>Variables</h3>

<p>Use the same color all over the place? Need to do some math with height and width and text size? Sass supports variables, math operations, and many useful functions.</p>

<pre class="code">$blue: #3bbfce;
$margin: 16px;

.content_navigation {
  border-color: $blue;
  color: darken($blue, 10%);
}

.border {
  padding: $margin / 2;
  margin: $margin / 2;
  border-color: $blue;
}</pre>

<h3 id='mixins'>Mixins</h3>

<p>Even more powerful than variables, mixins allow you to re-use whole chunks of CSS, properties or selectors. You can even give them arguments.</p>

<pre class="code">@mixin table-scaffolding {
  th {
    text-align: center;
    font-weight: bold;
  }
  td, th { padding: 2px; }
}

@mixin left($dist) {
  float: left;
  margin-left: $dist;
}

#data {
  @include left(10px);
  @include table-scaffolding;
}</pre>

<p>A comprehensive list of features is available in the <a href="javascript:if(confirm(%27http://beta.sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html  \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address.  \n\nDo you want to open it from the server?%27))window.location=%27http://beta.sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html%27" tppabs="http://beta.sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html">Sass reference</a>.</p>

<h2 id='executables'>Executables</h2>

<p>The Sass gem includes several executables that are useful for dealing with Sass from the command line.</p>

<h3 id='id1'><code>sass</code></h3>

<p>The <code>sass</code> executable transforms a source Sass file into CSS. See <code>sass --help</code> for further information and options.</p>

<h3 id='id2'><code>sass-convert</code></h3>

<p>The <code>sass-convert</code> executable converts between CSS, Sass, and SCSS. When converting from CSS to Sass or SCSS, nesting is applied where appropriate. See <code>sass-convert --help</code> for further information and options.</p>

<h2 id='authors'>Authors</h2>

<p>Sass was envisioned by <a href="javascript:if(confirm(%27http://www.hamptoncatlin.com/  \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address.  \n\nDo you want to open it from the server?%27))window.location=%27http://www.hamptoncatlin.com/%27" tppabs="http://www.hamptoncatlin.com/">Hampton Catlin</a> (@hcatlin). However, Hampton doesn&#8217;t even know his way around the code anymore and now occasionally consults on the language issues. Hampton lives in San Francisco, California and works as VP of Technology at <a href="javascript:if(confirm(%27http://www.moovweb.com/  \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address.  \n\nDo you want to open it from the server?%27))window.location=%27http://www.moovweb.com/%27" tppabs="http://www.moovweb.com/">Moovweb</a>.</p>

<p><a href="javascript:if(confirm(%27http://nex-3.com/  \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address.  \n\nDo you want to open it from the server?%27))window.location=%27http://nex-3.com/%27" tppabs="http://nex-3.com/">Nathan Weizenbaum</a> is the primary developer and architect of Sass. His hard work has kept the project alive by endlessly answering forum posts, fixing bugs, refactoring, finding speed improvements, writing documentation, implementing new features, and getting Hampton coffee (a fitting task for a boy-genius). Nathan lives in Seattle, Washington and works on <a href="javascript:if(confirm(%27http://dartlang.org/  \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address.  \n\nDo you want to open it from the server?%27))window.location=%27http://dartlang.org/%27" tppabs="http://dartlang.org/">Dart</a> application libraries at Google.</p>

<p><a href="javascript:if(confirm(%27http://acts-as-architect.blogspot.com/  \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address.  \n\nDo you want to open it from the server?%27))window.location=%27http://acts-as-architect.blogspot.com/%27" tppabs="http://acts-as-architect.blogspot.com/">Chris Eppstein</a> is a core contributor to Sass and the creator of Compass, the first Sass-based framework. Chris focuses on making Sass more powerful, easy to use, and on ways to speed its adoption through the web development community. Chris lives in San Jose, California with his wife and daughter. He is the Software Architect for <a href="javascript:if(confirm(%27http://caring.com/  \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address.  \n\nDo you want to open it from the server?%27))window.location=%27http://caring.com/%27" tppabs="http://caring.com/">Caring.com</a>, a website devoted to the 34 Million caregivers whose parents are sick or elderly, that uses Haml and Sass.</p>

<p>If you use this software, you must pay Hampton a compliment. And buy Nathan some jelly beans. Maybe pet a kitten. Yeah. Pet that kitty.</p>

<p>Beyond that, the implementation is licensed under the MIT License. Okay, fine, I guess that means compliments aren&#8217;t <strong>required</strong>.</p></div></div>
    
    <div id="footer">
  Generated on Fri Mar  8 20:33:26 2013 by 
  <a href="javascript:if(confirm(%27http://yardoc.org/  \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address.  \n\nDo you want to open it from the server?%27))window.location=%27http://yardoc.org/%27" tppabs="http://yardoc.org/" title="Yay! A Ruby Documentation Tool">yard</a>
  0.5.3 (ruby-1.8.7).
</div>


  <script type="text/javascript">
  var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
  document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
  </script>
  <script type="text/javascript">
  try {
  var pageTracker = _gat._getTracker("UA-535380-8");
  pageTracker._trackPageview();
  } catch(err) {}</script>


  </body>
</html>